(function($) {
    var init={
    		"bFilter": true,//搜索框
    		"aoColumns" : [
    		               {"data":"flowId"},
                           {
    		            	   "data" : "showAmount",
    		            	   "render": function(data, type, full) {
    		            		   return "￥"+formatCurrency(data);
    		            	   }

                           },
                        	   {
                            	   "data" : "tradeType",
                            	   "render": function(data, type, full) {
                            		   if(data==1)
                                       return "<span style=' color:green'>充值</span>";
                            		   if(data==2)
                                          return "<span style='color:red'>消费</span>";
                                       }
                               },
                              /* {
                               "data" : "frontCampaignType",
                               "render": function(data, type, full) {
                                   if(data==1)
                                      return "<span>PC端广告计划</span>";
                                   if(data==2)
                                      return "<span>移动端广告计划</span>";
                                   else
                                   return "<span></span>";
                               }
                               },*/
                           {
                            	   "data" : "tradeAt",
                            	   "render":function(data,type,full){
                            		   return formatDate(new Date(data));//时间格式化
                            	   }
                        	   },
                       ],
             "order": [[3, "desc"]],
             "sAjaxSource": "/account/flow?name=123"//这个是请求的地址
    }
    $(function(){ 
        $.extend(init,dataTableInit)
        $("#flowTable").dataTable(init);
    })
    
  //在表单外自定义搜索框
    $("#button").on( 'click ', function () {
    		//
    	  $("#flowTable").DataTable().column( 0 ).search(
    		     $('#startDate').val()
    		    );//保存信息
    	  $("#flowTable").DataTable().column( 1 ).search(
  		        $('#endDate').val()
  		    ).draw();//保存信息并发起请求
    } );
    
})($);